/*
 *	Copyright 2011 ja4cli
 *
 *	Licensed under the Apache License, Version 2.0 (the "License");
 *	you may not use this file except in compliance with the License.
 *	You may obtain a copy of the License at
 *
 *		http://www.apache.org/licenses/LICENSE-2.0
 *
 *	Unless required by applicable law or agreed to in writing, software
 *	distributed under the License is distributed on an "AS IS" BASIS,
 *	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *	See the License for the specific language governing permissions and
 *	limitations under the License.
 */
package org.skarby.ja4cli.samples;

import org.skarby.ja4cli.ArgumentsAnnotationParser;
import org.skarby.ja4cli.ArgumentsParser;
import org.skarby.ja4cli.ConfigurationParseException;
import org.skarby.ja4cli.Environment;
import org.skarby.ja4cli.ParseResult;
import org.skarby.ja4cli.annotations.Flag;

public class JCopy {
	private final JCopyConfiguration configuration;

	public JCopy(JCopyConfiguration configuration) {
		this.configuration = configuration;
	}
	
	public void execute() {
		
	}
	
	public static void main(String[] args) {
		// Set up the environment
		Environment environment = new Environment();
		environment.setDebugMode(true);
		
		// Create the parser
		ArgumentsParser parser = new ArgumentsAnnotationParser(environment);
		try {
			// Parse the configuration, using the configuration class and the application arguments 
			ParseResult<JCopyConfiguration> result = parser.parse(JCopyConfiguration.class, args);
			
			// Create the JCopy business logic class, pass on the configuration
			JCopy copy = new JCopy(result.getConfiguration());
			
			// Execute the business logic
			copy.execute();
		} catch (ConfigurationParseException e) {
			e.printStackTrace();
		}
	}
	
	public static class JCopyConfiguration {
		@Flag("--dry-run")
		private boolean dryrun;
	}
}
